<template>
  <!-- 详情 -->
  <el-dialog
    :visible.sync="dialogVisible"
    width="50%"
    append-to-body
    :close-on-click-modal="false"
    :before-close="closedialog"
  >
    <el-descriptions
      class="margin-top"
      title="口岸信息管理详情"
      :column="2"
      border
    >
      <el-descriptions-item>
        <template slot="label"> 口岸代码 </template>
        {{ form.portCode }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 中文名称 </template>
        {{ form.portEnName }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 英文名称 </template>
        {{ form.portCnName }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 关区代码 </template>
        {{ form.customsCode }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label"> 省份 </template>
        {{ form.province }}
      </el-descriptions-item>
    </el-descriptions>
    <div slot="footer" class="dialog-footer" style="text-align: center">
      <el-button @click="closedialog">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { getPortCodeInfo } from "@/api/swdecl/portCodeInfo";
export default {
  props: {
    dict: {},
  },
  data() {
    return {
      //显示详情
      dialogVisible: false,
      form: {
        portCode: null,
        portEnName: null,
        portCnName: null,
        customsCode: null,
        province: null,
      },
    };
  },
  methods: {
    open(id) {
      this.dialogVisible = true;
      this.loadDetail(id);
    },
    closedialog() {
      this.dialogVisible = false;
    },
    // 获取详情
    loadDetail(id) {
      getPortCodeInfo(id).then((res) => {
        if (res.code == 200) {
          this.form = res.data;
        }
      });
    },
  },
};
</script>

<style>
</style>
